package com.sdx.console.tdcard.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.tdcard.dao.TDCardDao;
import com.sdx.console.tdcard.entity.TDCard;
import com.ibeetl.admin.core.service.BaseService;

/**
 * 龙卡 Service
 */

@Service
@Transactional
public class TDCardService extends BaseService<TDCard>{

    @Resource
	private TDCardDao tDCardDao;

    public PageQuery<TDCard>queryByCondition(PageQuery query){
        PageQuery ret =  tDCardDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelTDCard(List<String> ids){
        try {
            tDCardDao.batchDelTDCardByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除龙卡失败", e);
        }
    }

	public List<TDCard> all() {
		return tDCardDao.all();
		}
}